HAL XSPI delay block functions migration

The goal of this page is to show how to migrate the delay block functions.

Set the delay block configuration

HAL1

HAL2

HAL_XSPI_DLYB_SetConfig(XSPI_HandleTypeDef *hxspi,
                        HAL_XSPI_DLYB_CfgTypeDef *const pdlyb_cfg);
HAL_XSPI_DLYB_SetConfigDelay(hal_xspi_handle_t *hxspi,
                             uint32_t clock_phase_value);

Example usage

HAL1

HAL2

XSPI_HandleTypeDef hxspi;
HAL_XSPI_DLYB_CfgTypeDef XSPI_DLYB_Cfg_Struct = {0};

XSPI_DLYB_Cfg_Struct.Units= DLYB_MAX_UNIT;
XSPI_DLYB_Cfg_Struct.PhaseSel= 2;

HAL_XSPI_DLYB_SetConfig(&hxspi, &XSPI_DLYB_Cfg_Struct);
hal_xspi_handle_t h_xspi;
uint32_t max_clk_phase;




HAL_XSPI_DLYB_SetConfigDelay(&h_xspi, max_clk_phase);

Get the delay block configuration

HAL1

HAL2

HAL_XSPI_DLYB_GetConfig(XSPI_HandleTypeDef *hxspi,
                        HAL_XSPI_DLYB_CfgTypeDef *pdlyb_cfg);
HAL_XSPI_DLYB_GetConfigDelay(const hal_xspi_handle_t *hxspi,
                             uint32_t *p_clock_phase);

Example usage

HAL1

HAL2

XSPI_HandleTypeDef hxspi;
HAL_XSPI_DLYB_CfgTypeDef XSPI_DLYB_Cfg_Struct = {0};

XSPI_DLYB_Cfg_Struct.Units= DLYB_MAX_UNIT;
XSPI_DLYB_Cfg_Struct.PhaseSel= 2;
HAL_XSPI_DLYB_GetConfig(&hxspi, &XSPI_DLYB_Cfg_Struct);
hal_xspi_handle_t hxspi;
uint32_t dlyb_cfg_test



HAL_XSPI_DLYB_GetConfigDelay(&hxspi, dlyb_cfg_test);

Get the delay line length value

HAL1

HAL2

HAL_XSPI_DLYB_GetClockPeriod(XSPI_HandleTypeDef *hxspi,
                             HAL_XSPI_DLYB_CfgTypeDef  *const pdlyb_cfg);
HAL_XSPI_DLYB_CalculateMaxClockPhase(hal_xspi_handle_t *hxspi,
                                     uint32_t *p_max_clock_phase);

Example usage

HAL1

HAL2

XSPI_HandleTypeDef hxspi;

HAL_XSPI_DLYB_CfgTypeDef XSPI_DLYB_Cfg_Struct = {0};

XSPI_DLYB_Cfg_Struct.Units= DLYB_MAX_UNIT;
XSPI_DLYB_Cfg_Struct.PhaseSel= 2;
HAL_XSPI_DLYB_GetClockPeriod(&hxspi, &XSPI_DLYB_Cfg_Struct);
hal_xspi_handle_t XSPIHandle;
uint32_t p_dlyb;




HAL_XSPI_DLYB_CalculateMaxClockPhase(&XSPIHandle, &p_dlyb);